-- spell_bonus
-- created by panyl
-- 每进入下一层时，概率获得未来猫道具

return {
    apply = function(prop, baseValue)
        return prop[3];
    end,

    -- 进入下一层触发
    trigger = function(who, prop, arg)
        -- 概率不满足
        if DungeonM.getRandSeed("doraemon") % 1000 >= prop[3] then
            return;
        end

        local bonus = FormulaM.invoke("CALC_DORAEMON_BONUS");

        BonusM.doBonus(bonus, "doraemon");

        -- 触发特技发动事件, 先记在玩家身上
        ME.user.dbase:setTemp("speicial_skill_trigger", prop[1]);
    end,

    desc = function(prop)
        local row = PropM.getRow(prop[1]);
        local desc = row.desc;
        if prop[4] > 0 then
            desc = row.append_desc;
        end

        local value = math.modf(prop[3] / 10);
        desc = string.gsub(desc, "{1}", value);

        return desc;
    end,

    record = function(target, prop, path)
        return false;
    end
};
